<?php
namespace app\suguan\logic;
use think\Model;

class File extends Model
{
    /**
     * 获取数组数据，组装成js需要
     * @param  [type] $ids [description]
     * @return [type]      [description]
     */
    public function getList($ids)
    {
        $list = $this->where('id', 'in', $ids)->field('*, title as name')->select()->each(function($item, $key){
            $item->url = model("File")->getPath($item->id, true);
        });
        return $list->toArray();
    }
}